package com.example.eelly.aspectjprojectdemo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.example.eelly.aspectjprojectdemo.jjj.Page2;

@AspectJClass.PageIndex(label = "我是入来的Activity")
public class MainActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(v.getContext(),"Click Down",Toast.LENGTH_SHORT);
                TestFunction(123,"sss");
                startActivity(new Intent(MainActivity.this,Page2.class));
            }
        });


    }

    @AspectJClass.PageAction(actionName = "TestFunction")
    public void TestFunction(int v1,String v2){
        Toast.makeText(MainActivity.this, String.valueOf(v2),Toast.LENGTH_SHORT).show();
    }

    @Override
    void onBaseDestroy() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
